package com.demo.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.demo.core.exception.ParameterException;
import com.demo.domain.PracticalAchievement;
import com.demo.domain.PracticalAchievementFile;
import com.demo.domain.TeamComposition;
import com.demo.domain.ro.AchievementSearchRequest;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public interface PracticalAchievementService extends IService<PracticalAchievement> {
    /**得到所有实践成果
     *
     * @param uid
     * @return
     */
    Page<PracticalAchievement> getAllAchievement(int type,int current,int size,Long uid) throws ParameterException,Exception;


    /**
     * 搜索实践成果
     *
     * @param searchRequest
     * @return
     * @throws Exception
     */
    Page searchAchievements(AchievementSearchRequest searchRequest) throws Exception;

    /**
     * 得到某个实践成果的详细介绍
     *
     * @param searchRequest
     * @return
     * @throws Exception
     */
    PracticalAchievement getAchievement(AchievementSearchRequest searchRequest) throws Exception;

    /**
     * 导出实践成果
     * @param request
     * @param response
     * @param ids
     */
    void exportExcel(HttpServletRequest request, HttpServletResponse response,List<Long> ids);


    /**
     * 是否有权限下载实践成果
     * @param uid
     * @param ids
     * @return
     */
    boolean isAchievementEmpty(Long uid,List<Long> ids);

    /**
     * 新增实践成果
     * @param practicalAchievement
     * @return
     * @throws Exception
     */
    PracticalAchievement importAchievement(PracticalAchievement practicalAchievement) throws Exception;


    boolean importAchievementAndFile(PracticalAchievement practicalAchievement, MultipartFile files[]);


    String getTitleById(long paid);

    List<PracticalAchievement> getAllByLevel(AchievementSearchRequest searchRequest, Long uid);

    List<PracticalAchievement> selectPracticalAchievementList(PracticalAchievement practicalAchievement) throws ParameterException;

    List<PracticalAchievement> listAllPracticalAchievement();

    Integer updatePracticalAchievement(PracticalAchievement practicalAchievement) throws ParameterException;

    Integer deletePracticalAchievementById(PracticalAchievement practicalAchievement) throws ParameterException;
}
